
# Project Euler - Problem 66

import time
from math import sqrt


def isSquare(num):
	result = sqrt(num)
	if result - int(result) == 0:
		return True
	return False

start = time.time()
m = 0
preX = 0
for d in range(1, 14):
	if not isSquare(d):
		y = 1
		while True:
			sum = 1 + d * y**2
			#print sum
			if isSquare(sum):
				x = int(sqrt(sum))
				m = max(m, x)
				break
			y += 1
			#print y
		print d

print m
print "%.8f Secs" % (time.time() - start)
